package com.zz.examination.dto;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

@Data
public class QuestionAnswerDto {
    /**
     * 考题内容
     */
    private String quesContent;

    /**
     * 答案总数
     */
    private BigDecimal answerTotalCount;

    /**
     * 正确答案ID
     */
    private String rightAnswerId;

    /**
     * 解析
     */
    private String analysis;

    /**
     * 答案内容
     */
    private String ansContents;

    /**
     * 答案内容List
     */
    private List<String> ansContentList;

    /**
     * 错误答案（多个）
     */
    private String wrongAnswers;

    public List<String> getAnsContentList() {
        String ansContents = this.getAnsContents();
        return Arrays.asList(StringUtils.split(ansContents, '|'));
    }
}
